home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: SLCH.dopus5 1.0 (26.9.98)
- Simple Lister Custom Handler
- */
- signal on error
- signal on syntax
- signal on halt
- signal on break_c
-
- address DOPUS.1
- options results
- options failat 11
-
- dopus front
-
- if ~show('l','rexxsupport.library') then
- call addlib('rexxsupport.library',,-30)
-
- call open('window','CON:0/12/640/240/SLCH.dopus5')
-
- lister new
- handle=result
- lister read handle 'SYS:' force
- lister wait handle
- lister set handle handler 'SLCH-handler' subdrop quotes
- call openport('SLCH-handler')
-
- /* We are going to trap everything */
- dopus addtrap '*' 'SLCH-handler'
-
- do while event ~= 'inactive'
- if waitpkt('SLCH-handler') then do
- packet = getpkt('SLCH-handler')
- if packet ~= '00000000'x then do
- event = getarg(packet,0)
- handle = getarg(packet,1)
- name = getarg(packet,2)
- user = getarg(packet,3)
- pathstr = getarg(packet,4)
- arguments = getarg(packet,5)
- qualifier = getarg(packet,6)
- deststr = getarg(packet,7)
-
- call writeln('window','--------------------')
- call writeln('window','Arg0 (event) =' event)
- call writeln('window','Arg1 (handle) =' handle)
- call writeln('window','Arg2 (name) =' name)
- call writeln('window','Arg3 (user) =' user)
- call writeln('window','Arg4 (path) =' pathstr)
- call writeln('window','Arg5 (arguments) =' arguments)
- call writeln('window','Arg6 (qualifier) =' qualifier)
- call writeln('window','Arg7 (destination) =' deststr)
- end
- call reply(packet,0)
- end
- end
-
- /* remove all traps for my handler */
- error:
- syntax:
- halt:
- break_c:
- dopus remtrap '*' 'SLCH-handler'
- call closeport('SLCH-handler')
- if rc = 0 then call delay(100)
- call close('window')
- if rc ~= 0 then do
- text = 'Error: 'rc', 'errortext(rc)' in line 'sigl'.'
- dopus request '"'text'" OK'
- end
- exit
-